home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / C Libraries / MemoryTools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  908 b   |  31 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. /*=======================================================================*/
  4. /*====== This file contains a set of utilities for managing memory ======*/
  5. /*=======================================================================*/
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11.     #define NukeHandle(h)     DoNukeHandle( (Handle*) &h)
  12.     #define NukePtr(p)         DoNukePtr( (Ptr*) &p)
  13.  
  14.     Ptr    Ptr2Ptr (Ptr InData);
  15.     /* return a copy of the pointer passed in InData */
  16.  
  17.     Handle    Ptr2Hand (Ptr Data);
  18.     /* create a handle containing the same data as the passed-in pointer */
  19.  
  20.     Ptr    Hand2Ptr (Handle Data);
  21.     /* create a ptr containing the same data as the passed-in handle */
  22.  
  23.     void DoNukePtr (Ptr *PtrAddr);
  24.     /* dispose of the memory pointed to by ThePtr, and set it to NULL */
  25.  
  26.     void DoNukeHandle (Handle *HandleAddr);
  27.     /* dispose of the memory pointed to by TheHandle, and set it to NULL */
  28.  
  29. #ifdef __cplusplus
  30. }
  31. #endif